package com.hfkh.java65;

import java.time.LocalDate;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class Coder {
    private String workNum;
    private String name;
    private LocalDate birthday;
    private String gender;
    private String hobby;
    
    
    
    public Coder(){}

    public Coder(String woekNum,String name,LocalDate birthday,String gender,String hobby) {
        this.setWorkNum(workNum);
        this.setName(name);
        this.setBirthday(birthday);
        this.setGender(gender);
        this.setHobby(hobby);
    }

    public String getWorkNum(){
        return this.workNum;
    }
    public void setWorkNum(String workNum){
        if (workNum.length()==7){
            this.workNum = workNum;
        }
        else{
            System.out.println("员工工号为7为数");
        }
    }

    public String getName(){
        return this.name;
    }
    public void setName(String name){
        this.name = name;
    }

    public LocalDate getBirthday() {
        return this.birthday;
    }

    public void setBirthday(LocalDate birthday) {
        this.birthday = birthday;
    }

    public String getGender() {
        return this.gender;
    }

    public void setGender(String gender) {
        if ("男".equals(gender)||"女".equals(gender)){
            this.gender = gender;
        }
        else{
            this.name = "男";
            System.out.println("性别只能为男或女");
        }
    }

    public String getHobby() {
        return this.hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

}
